home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / euphor14.zip / BENCH.DOC < prev    next >
Text File  |  1996-10-15  |  5KB  |  111 lines

  1.         Benchmark Results
  2.         =================
  3.  
  4.  In this directory there are a series of benchmark programs written in
  5.  Euphoria and Microsoft QBasic.  
  6.  
  7.  QBasic should be available to you if you have MS-DOS 5.0 or later, although it 
  8.  might not be installed under Windows 95. To run a QBasic program type: 
  9.     qbasic /run filename.bas 
  10.  
  11.  To run a Euphoria program type:
  12.     ex filename.ex
  13.  
  14.  The .ex and .bas suffixes are both optional.
  15.  
  16.  Each benchmark will run for about 15 seconds before reporting a result.
  17.  
  18.  We've also included "filesort.ex" - a tiny Euphoria program that we clocked
  19.  at 9.6x the speed of the MS-DOS "sort" command on a 2000-line input file. 
  20.  Furthermore, filesort.ex uses extended memory to sort files that are too big
  21.  for MS-DOS sort. Type: 
  22.  
  23.         ex filesort < input_file > sorted_file
  24.                vs.
  25.     sort < input_file > sorted_file
  26.  
  27.  Using conventional technology, Euphoria could have been developed to run at 
  28.  the speed of BASIC. In fact you'd expect it to run *slower* than BASIC, 
  29.  since data types are not predetermined and fixed; it checks for uninitialized
  30.  variables; it has dynamic storage allocation, etc. In fact, Euphoria programs
  31.  run 10 to 20, or even more times faster than equivalent programs in Microsoft
  32.  QBasic. And QBasic is not particularly slow. Look at some other results: 
  33.  
  34.  Language              Benchmark       Result
  35.  --------              ---------       ------
  36.  Java (JDK 1.0.2)       sieve        Euphoria is   8x faster
  37.  Perl (PC version)    fibonnacci    Euphoria is  65x faster
  38.  PC-LISP v3.0        queens        Euphoria is  28x faster
  39.  Small C Interpreter    sieve        Euphoria is 545x faster
  40.  
  41.  We have yet to find an interpreter that even comes close to Euphoria in speed.
  42.  
  43.  Compare Euphoria against any interpreted or compiled language that you are 
  44.  interested in. Euphoria is * F A S T * -- but don't take our word for it. 
  45.  Make your own measurements on your own machine. 
  46.  
  47.  About The Benchmarks
  48.  --------------------
  49.  sieve is based on the classic Byte magazine benchmark. It generates a list of 
  50.        prime numbers using the sieve technique.
  51.  
  52.  shell is a sort of 50 integers using the Shell sort technique.
  53.  
  54.  database is a series of transactions against a small in-memory data structure
  55.        that must sometimes grow or shrink as information is added, deleted or
  56.        updated.
  57.  
  58.  sequence shows the *extra* (turbo!) speed you get when you let Euphoria 
  59.        process entire sequences of data in a single statement. 
  60.  
  61.  When benchmarking Euphoria programs you should include the statement
  62.  "without type_check" at the top of the main file. This gives permission
  63.  to Euphoria to simplify or remove some runtime type checking.  An 
  64.  unexplained machine exception will still be impossible, and as always, 
  65.  subscript checking, uninitialized variable checking, integer overflow 
  66.  checking, stack overflow checking, and all other checks are still performed.
  67.  Do not turn on profiling or tracing for benchmark runs.
  68.  
  69.  We gave QBasic the benefit of the doubt by declaring 16-bit integers, 
  70.  "DEFINT A-Z". Declaring 32-bit integers, "DEFLNG A-Z", slows things down 
  71.  significantly. Also, in some cases we used QBasic character-string operations
  72.  to compare with the much more general Euphoria sequence operations.
  73.  
  74.  The Euphoria interpreter achieves its high speed while maintaining the 
  75.  ultimate in language flexibility and runtime safety. 
  76.  
  77.  Comparison with Microsoft QBasic
  78.  -------------------------------- 
  79.  The measurements below were made on a 486DX-50 with 256K cache using 
  80.  Euphoria 1.4 PD Edition running under DOS 6.2. 
  81.  
  82.                          QBasic         Euphoria     speed ratio    
  83.  scalar benchmarks:
  84.    sieves per second ...........      48.44            561.5         11.6
  85.    sorts per second ............      74.02           1033.3         14.0
  86.    transactions per second .....    2349             34569           14.7
  87.  
  88.  sequence benchmarks:
  89.    initializations per second ..    1100             45733           41.6
  90.    sequence-adds per second ....     598             10631           17.8
  91.    appends per second ..........    6258            475083           75.9
  92.    slices per second ...........    5587            160405           28.7
  93.    look-ups per second .........     641             26533           41.4
  94.  
  95. -------------------------------------------------------------------------------
  96.  
  97.             Conclusions
  98.             -----------
  99.  Interpreted programming languages are enjoyable and productive to use
  100.  due to their simplicity, ease-of-use, flexibility, runtime safety, 
  101.  debuggability etc. The only drawback is speed. Compiled languages like C/C++
  102.  have dominated, despite the fact that they are harder to learn, harder to use,
  103.  difficult to debug, cause mysterious crashes, and require you to compile and
  104.  link after every small change. Programmers have put up with this inconvenient,
  105.  often frustrating, low-productivity environment for essentially one reason: 
  106.  speed.
  107.  
  108.  With the introduction of Euphoria, programmers can now have the best of 
  109.  both worlds! 
  110.   
  111.